$.extend({
    CommonMainRoom: {
        ////////////////////////////////////
        //SocketIO
        ////////////////////////////////////
        SocketIO: null,
        ////////////////////////////////////
        //是否进入房间
        ////////////////////////////////////
        Join: false,
        ////////////////////////////////////
        //房间配置
        ////////////////////////////////////
        RoomConfig: {
            SocketURL: null,
            RoomID: null,
            onConnect: null,
            onDisconnect: null,
            onJoin: null,
            onJoinBroadcast: null,
            onOutBroadcast: null,
            onUserList: null,
            onAdminList: null,
            onBlackList: null,
            onGuardianList: null,
            onUserLevelBroadcast: null,
            onLive: null,
            onLiveBroadcast: null,
            onRunwayBroadcast: null,
            onGuardian: null,
            onGuardianBroadcast: null,
            onGift: null,
            onGiftBroadcast: null,
            onGiftHeadlineBroadcast: null,
            onHorn: null,
            onHornBroadcast: null,
            onPomeloGet: null,
            onPomeloPresent: null,
            onPomeloPresentBroadcast: null,
            onMessage: null,
            onMessageBroadcast: null,
            onAdminSet: null,
            onAdminSetBroadcast: null,
            onBlackSet: null,
            onBlackSetBroadcast: null,
            // onBlockSet: null,
            onWarningSet: null,
            onWarningSetBroadcast: null,
            onLottery: null,
            onLotteryBroadcast: null,
            onPoundEgg: null,
            onPoundEggBroadcast: null,
            fnGiftFloat: null,
            fnGiftHeadline: null,
            fnBlackJoin: null,
            fnRoomInfo: null,
            fnRoomUserInfo: null,
            fnRoomAnchorInfo: null,
            fnRoomGiftPond: null,
            fnRoomGuardian: null,
            fnUserPackage: null,
            fnErrorNotEnough: null,
            fnErrorOther: null
        },
        ////////////////////////////////////
        //房间信息
        ////////////////////////////////////
        RoomInfo: null,
        ////////////////////////////////////
        //房间艺人信息
        ////////////////////////////////////
        RoomAnchorInfo: null,
        ////////////////////////////////////
        //房间用户信息
        ////////////////////////////////////
        RoomUserInfo: null,
        ////////////////////////////////////
        //用户包裹信息
        ////////////////////////////////////
        UserPackage: null,
        ////////////////////////////////////
        //fnCheckData
        ////////////////////////////////////
        fnCheckData: function (name, data, tips) {
            if (data.flag === 0) {
                console.log("On." + name + ".Succeed");
                return true;
            }
            console.log("On." + name + ".Error", data);
            switch (data.flag) {
                case -1:
                    //显示登录窗口
                    $.CommonMain.Login("In");
                    return false;
                case -2:
                    //显示充值窗口
                    if ($.CommonMainRoom.RoomConfig.fnErrorNotEnough && typeof $.CommonMainRoom.RoomConfig.fnErrorNotEnough === "function") {
                        $.CommonMainRoom.RoomConfig.fnErrorNotEnough(data);
                    } else {
                        $.KOC.Tips.Open("Warning", data.message, {
                            Timeout: 3000
                        });
                    }
                    return false;
            }
            if (tips !== false) {
                if ($.CommonMainRoom.RoomConfig.fnErrorOther && typeof $.CommonMainRoom.RoomConfig.fnErrorOther === "function") {
                    $.CommonMainRoom.RoomConfig.fnErrorOther(data);
                } else {
                    $.KOC.Tips.Open("Error", data.message + "(" + data.flag + ")", {Timeout: 3000});
                }
            }
            return false;
        },
        ////////////////////////////////////
        //fnInit
        ////////////////////////////////////
        fnInit: function (Value) {
            ////////////////////////////////////
            //初始化配置
            ////////////////////////////////////
            Value = this.RoomConfig = $.extend(true, {}, this.RoomConfig, Value);
            ////////////////////////////////////
            //初始化SocketIO
            ////////////////////////////////////
            this.SocketIO = io(Value.SocketURL);
            ////////////////////////////////////
            //连接
            ////////////////////////////////////
            this.SocketIO.on("connect", function () {
                console.log("On.Connect.Succeed");
                $.CommonMainRoom.Join = false;
                $.CommonMainRoom.SocketEmit.Join(Value.RoomID);
                if (Value.onConnect && typeof Value.onConnect === "function") {
                    Value.onConnect();
                }
            });
            ////////////////////////////////////
            //断开连接
            ////////////////////////////////////
            this.SocketIO.on("disconnect", function () {
                console.log("On.Disconnect.Succeed");
                $.CommonMainRoom.Join = false;
                if (Value.onDisconnect && typeof Value.onDisconnect === "function") {
                    Value.onDisconnect();
                }
            });
            ////////////////////////////////////
            //进入房间
            ////////////////////////////////////
            this.SocketIO.on("Join", function (data) {
                if (data.flag === 999 && Value.fnBlackJoin && typeof Value.fnBlackJoin === "function") {
                    console.log("On.Join.Error", data);
                    Value.fnBlackJoin(data.message);
                    return;
                }
                if (!$.CommonMainRoom.fnCheckData("Join", data)) {
                    return;
                }
                data = data.Data;
                $.CommonMainRoom.RoomInfo = data.RoomInfo;
                $.CommonMainRoom.RoomAnchorInfo = data.RoomAnchorInfo;
                $.CommonMainRoom.RoomUserInfo = data.RoomUserInfo;
                $.CommonMainRoom.UserPackage = data.UserPackage || $.CommonMainRoom.UserPackage;
                $.CommonMainRoom.Join = true;
                if (Value.fnRoomInfo && typeof Value.fnRoomInfo === "function") {
                    Value.fnRoomInfo(data.RoomInfo);
                }
                if (Value.fnRoomUserInfo && typeof Value.fnRoomUserInfo === "function") {
                    Value.fnRoomUserInfo(data.RoomUserInfo);
                }
                if (Value.fnRoomAnchorInfo && typeof Value.fnRoomAnchorInfo === "function") {
                    Value.fnRoomAnchorInfo(data.RoomAnchorInfo);
                }
                if (data.UserPackage && Value.fnUserPackage && typeof Value.fnUserPackage === "function") {
                    Value.fnUserPackage(data.UserPackage);
                }
                if (data.GiftFloat && data.GiftFloat.length > 0 && Value.fnGiftFloat && typeof Value.fnGiftFloat === "function") {
                    _.forEach(data.GiftFloat, function (ThisValue) {
                        Value.fnGiftFloat(ThisValue);
                    });
                }
                if (data.GiftHeadline && Value.fnGiftHeadline && typeof Value.fnGiftHeadline == "function") {
                    Value.fnGiftHeadline(data.GiftHeadline);
                }
                if (Value.onJoin && typeof Value.onJoin === "function") {
                    Value.onJoin(data);
                }
            });
            ////////////////////////////////////
            //进入房间(广播)
            ////////////////////////////////////
            this.SocketIO.on("JoinBroadcast", function (data) {
                console.log("On.JoinBroadcast.Succeed");
                if (Value.onJoinBroadcast && typeof Value.onJoinBroadcast === "function") {
                    Value.onJoinBroadcast(data);
                }
            });
            ////////////////////////////////////
            //退出房间(广播)
            ////////////////////////////////////
            this.SocketIO.on("OutBroadcast", function (data) {
                console.log("On.OutBroadcast.Succeed");
                if (Value.onOutBroadcast && typeof Value.onOutBroadcast === "function") {
                    Value.onOutBroadcast(data);
                }
            });
            ////////////////////////////////////
            //用户列表
            ////////////////////////////////////
            this.SocketIO.on("UserList", function (data) {
                if (!$.CommonMainRoom.fnCheckData("UserList", data)) {
                    return;
                }
                data = data.Data;
                if (Value.onUserList && typeof Value.onUserList === "function") {
                    Value.onUserList(data);
                }
            });
            ////////////////////////////////////
            //管理员列表
            ////////////////////////////////////
            this.SocketIO.on("AdminList", function (data) {
                if (!$.CommonMainRoom.fnCheckData("AdminList", data)) {
                    return;
                }
                data = data.Data;
                if (Value.onAdminList && typeof Value.onAdminList === "function") {
                    Value.onAdminList(data);
                }
            });
            ////////////////////////////////////
            //黑名单列表
            ////////////////////////////////////
            this.SocketIO.on("BlackList", function (data) {
                if (!$.CommonMainRoom.fnCheckData("BlackList", data)) {
                    return;
                }
                data = data.Data;
                if (Value.onBlackList && typeof Value.onBlackList === "function") {
                    Value.onBlackList(data);
                }
            });
            ////////////////////////////////////
            //守护列表
            ////////////////////////////////////
            this.SocketIO.on("GuardianList", function (data) {
                if (!$.CommonMainRoom.fnCheckData("GuardianList", data)) {
                    return;
                }
                data = data.Data;
                if (Value.onGuardianList && typeof Value.onGuardianList === "function") {
                    Value.onGuardianList(data);
                }
            });
            ////////////////////////////////////
            //用户升级(广播)
            ////////////////////////////////////
            this.SocketIO.on("UserLevelBroadcast", function (data) {
                console.log("On.UserLevelBroadcast.Succeed");
                if (Value.onUserLevelBroadcast && typeof Value.onUserLevelBroadcast === "function") {
                    Value.onUserLevelBroadcast(data);
                }
            });
            ////////////////////////////////////
            //直播开始
            ////////////////////////////////////
            this.SocketIO.on("Live", function (data) {
                if (!$.CommonMainRoom.fnCheckData("Live", data)) {
                    return;
                }
                data = data.Data;
                $.CommonMainRoom.RoomInfo = data.RoomInfo;
                if (Value.fnRoomInfo && typeof Value.fnRoomInfo === "function") {
                    Value.fnRoomInfo(data.RoomInfo);
                }
                if (Value.onLive && typeof Value.onLive === "function") {
                    Value.onLive(data);
                }
            });
            ////////////////////////////////////
            //直播结束
            ////////////////////////////////////
            this.SocketIO.on("LiveEnd", function (data) {
                $.CommonMainRoom.fnCheckData("LiveEnd", data);
            });
            ////////////////////////////////////
            //直播(广播)
            ////////////////////////////////////
            this.SocketIO.on("LiveBroadcast", function (data) {
                console.log("On.LiveBroadcast.Succeed");
                $.CommonMainRoom.RoomInfo = data.RoomInfo;
                if (Value.fnRoomInfo && typeof Value.fnRoomInfo === "function") {
                    Value.fnRoomInfo(data.RoomInfo);
                }
                if (Value.onLiveBroadcast && typeof Value.onLiveBroadcast === "function") {
                    //////////////////////////////////
                    //Type
                    //Live:开始直播(艺人)
                    //LiveEnd:结束直播(艺人)
                    //LiveEnd-Disconnect:结束直播(包括连麦)-用户退出
                    //LiveEnd-BlackSet:结束直播(包括连麦)-用户被拉黑
                    //LiveEnd-WarningSet-End:结束直播(所有)-房间警告-结束
                    //LiveEnd-WarningSet-Block:结束直播(所有)-房间警告-冻结
                    //////////////////////////////////
                    Value.onLiveBroadcast(data);
                }
            });
            ////////////////////////////////////
            //跑道(广播)
            ////////////////////////////////////
            this.SocketIO.on("RunwayBroadcast", function (data) {
                console.log("On.onRunwayBroadcast.Succeed");
                if (Value.onRunwayBroadcast && typeof Value.onRunwayBroadcast === "function") {
                    Value.onRunwayBroadcast(data);
                }
            });
            ////////////////////////////////////
            //守护购买
            ////////////////////////////////////
            this.SocketIO.on("Guardian", function (data) {
                if (!$.CommonMainRoom.fnCheckData("Guardian", data)) {
                    return;
                }
                data = data.Data;
                $.CommonMainRoom.RoomAnchorInfo = data.RoomAnchorInfo;
                $.CommonMainRoom.RoomUserInfo = data.RoomUserInfo;
                if (Value.fnRoomAnchorInfo && typeof Value.fnRoomAnchorInfo === "function") {
                    Value.fnRoomAnchorInfo(data.RoomAnchorInfo);
                }
                if (Value.fnRoomUserInfo && typeof Value.fnRoomUserInfo === "function") {
                    Value.fnRoomUserInfo(data.RoomUserInfo);
                }
                if (Value.fnRoomGuardian && typeof Value.fnRoomGuardian === "function") {
                    Value.fnRoomGuardian(data.RoomUserInfo);
                }
                if (Value.onGuardian && typeof Value.onGuardian === "function") {
                    Value.onGuardian(data);
                }
            });
            ////////////////////////////////////
            //守护购买(广播)
            ////////////////////////////////////
            this.SocketIO.on("GuardianBroadcast", function (data) {
                console.log("On.GuardianBroadcast.Succeed");
                $.CommonMainRoom.RoomAnchorInfo = data.RoomAnchorInfo;
                if (Value.fnRoomAnchorInfo && typeof Value.fnRoomAnchorInfo === "function") {
                    Value.fnRoomAnchorInfo(data.RoomAnchorInfo);
                }
                if (Value.fnRoomGuardian && typeof Value.fnRoomGuardian === "function") {
                    Value.fnRoomGuardian(data.RoomUserInfo);
                }
                if (Value.onGuardianBroadcast && typeof Value.onGuardianBroadcast === "function") {
                    Value.onGuardianBroadcast(data);
                }
            });
            ////////////////////////////////////
            //礼物购买
            ////////////////////////////////////
            this.SocketIO.on("Gift", function (data) {
                if (!$.CommonMainRoom.fnCheckData("Gift", data)) {
                    return;
                }
                data = data.Data;
                $.CommonMainRoom.RoomAnchorInfo = data.RoomAnchorInfo;
                $.CommonMainRoom.RoomUserInfo = data.RoomUserInfo;
                $.CommonMainRoom.UserPackage = data.UserPackage || $.CommonMainRoom.UserPackage;
                if (Value.fnRoomAnchorInfo && typeof Value.fnRoomAnchorInfo === "function") {
                    Value.fnRoomAnchorInfo(data.RoomAnchorInfo);
                }
                if (Value.fnRoomUserInfo && typeof Value.fnRoomUserInfo === "function") {
                    Value.fnRoomUserInfo(data.RoomUserInfo);
                }
                if (data.GiftPond && Value.fnRoomGiftPond && typeof Value.fnRoomGiftPond === "function") {
                    Value.fnRoomGiftPond(data.GiftPond);
                }
                if (data.GiftFloat && Value.fnGiftFloat && typeof Value.fnGiftFloat === "function") {
                    Value.fnGiftFloat(data.GiftFloat);
                }
                if (data.UserPackage && Value.fnUserPackage && typeof Value.fnUserPackage === "function") {
                    Value.fnUserPackage(data.UserPackage);
                }
                if (Value.onGift && typeof Value.onGift === "function") {
                    Value.onGift(data);
                }
            });
            ////////////////////////////////////
            //礼物购买(广播)
            ////////////////////////////////////
            this.SocketIO.on("GiftBroadcast", function (data) {
                console.log("On.GiftBroadcast.Succeed");
                $.CommonMainRoom.RoomAnchorInfo = data.RoomAnchorInfo;
                if (Value.fnRoomAnchorInfo && typeof Value.fnRoomAnchorInfo === "function") {
                    Value.fnRoomAnchorInfo(data.RoomAnchorInfo);
                }
                if (data.GiftPond && Value.fnRoomGiftPond && typeof Value.fnRoomGiftPond === "function") {
                    Value.fnRoomGiftPond(data.GiftPond);
                }
                if (data.GiftFloat && Value.fnGiftFloat && typeof Value.fnGiftFloat === "function") {
                    Value.fnGiftFloat(data.GiftFloat);
                }
                if (Value.onGiftBroadcast && typeof Value.onGiftBroadcast === "function") {
                    Value.onGiftBroadcast(data);
                }
            });
            ////////////////////////////////////
            //礼物头条(广播)
            ////////////////////////////////////
            this.SocketIO.on("GiftHeadlineBroadcast", function (data) {
                console.log("On.onGiftHeadlineBroadcast.Succeed");
                if (Value.fnGiftHeadline && typeof Value.fnGiftHeadline === "function") {
                    Value.fnGiftHeadline(data);
                }
                if (Value.onGiftHeadlineBroadcast && typeof Value.onGiftHeadlineBroadcast === "function") {
                    Value.onGiftHeadlineBroadcast(data);
                }
            });
            ////////////////////////////////////
            //喇叭购买
            ////////////////////////////////////
            this.SocketIO.on("Horn", function (data) {
                if (!$.CommonMainRoom.fnCheckData("Horn", data)) {
                    return;
                }
                data = data.Data;
                $.CommonMainRoom.RoomAnchorInfo = data.RoomAnchorInfo;
                $.CommonMainRoom.RoomUserInfo = data.RoomUserInfo;
                $.CommonMainRoom.UserPackage = data.UserPackage || $.CommonMainRoom.UserPackage;
                if (Value.fnRoomAnchorInfo && typeof Value.fnRoomAnchorInfo === "function") {
                    Value.fnRoomAnchorInfo(data.RoomAnchorInfo);
                }
                if (Value.fnRoomUserInfo && typeof Value.fnRoomUserInfo === "function") {
                    Value.fnRoomUserInfo(data.RoomUserInfo);
                }
                if (data.UserPackage && Value.fnUserPackage && typeof Value.fnUserPackage === "function") {
                    Value.fnUserPackage(data.UserPackage);
                }
                if (Value.onHorn && typeof Value.onHorn === "function") {
                    Value.onHorn(data);
                }
            });
            ////////////////////////////////////
            //喇叭购买(广播)
            ////////////////////////////////////
            this.SocketIO.on("HornBroadcast", function (data) {
                console.log("On.HornBroadcast.Succeed");
                if ($.CommonMainRoom.RoomInfo.RoomID == data.RoomAnchorInfo.RoomID) {
                    $.CommonMainRoom.RoomAnchorInfo = data.RoomAnchorInfo;
                    if (Value.fnRoomAnchorInfo && typeof Value.fnRoomAnchorInfo === "function") {
                        Value.fnRoomAnchorInfo(data.RoomAnchorInfo);
                    }
                }
                if (Value.onHornBroadcast && typeof Value.onHornBroadcast === "function") {
                    Value.onHornBroadcast(data);
                }
            });
            ////////////////////////////////////
            //星星获取
            ////////////////////////////////////
            this.SocketIO.on("PomeloGet", function (data) {
                if (!$.CommonMainRoom.fnCheckData("PomeloGet", data, false)) {
                    return;
                }
                data = data.Data;
                $.CommonMainRoom.RoomUserInfo = data;
                if (Value.fnRoomUserInfo && typeof Value.fnRoomUserInfo === "function") {
                    Value.fnRoomUserInfo(data);
                }
                if (Value.onPomeloGet && typeof Value.onPomeloGet === "function") {
                    Value.onPomeloGet(data);
                }
            });
            ////////////////////////////////////
            //星星赠送
            ////////////////////////////////////
            this.SocketIO.on("PomeloPresent", function (data) {
                if (!$.CommonMainRoom.fnCheckData("PomeloPresent", data)) {
                    return;
                }
                data = data.Data;
                $.CommonMainRoom.RoomAnchorInfo = data.RoomAnchorInfo;
                $.CommonMainRoom.RoomUserInfo = data.RoomUserInfo;
                if (Value.fnRoomAnchorInfo && typeof Value.fnRoomAnchorInfo === "function") {
                    Value.fnRoomAnchorInfo(data.RoomAnchorInfo);
                }
                if (Value.fnRoomUserInfo && typeof Value.fnRoomUserInfo === "function") {
                    Value.fnRoomUserInfo(data.RoomUserInfo);
                }
                if (Value.onPomeloPresent && typeof Value.onPomeloPresent === "function") {
                    Value.onPomeloPresent(data);
                }
            });
            ////////////////////////////////////
            //星星赠送(广播)
            ////////////////////////////////////
            this.SocketIO.on("PomeloPresentBroadcast", function (data) {
                console.log("On.PomeloPresentBroadcast.Succeed");
                $.CommonMainRoom.RoomAnchorInfo = data.RoomAnchorInfo;
                if (Value.fnRoomAnchorInfo && typeof Value.fnRoomAnchorInfo === "function") {
                    Value.fnRoomAnchorInfo(data.RoomAnchorInfo);
                }
                if (Value.onPomeloPresentBroadcast && typeof Value.onPomeloPresentBroadcast === "function") {
                    Value.onPomeloPresentBroadcast(data);
                }
            });
            ////////////////////////////////////
            //发送消息
            ////////////////////////////////////
            this.SocketIO.on("Message", function (data) {
                if (!$.CommonMainRoom.fnCheckData("Message", data)) {
                    return;
                }
                data = data.Data;
                if (Value.onMessage && typeof Value.onMessage === "function") {
                    Value.onMessage(data);
                }
            });
            ////////////////////////////////////
            //发送消息(广播)
            ////////////////////////////////////
            this.SocketIO.on("MessageBroadcast", function (data) {
                console.log("On.MessageBroadcast.Succeed");
                if (Value.onMessageBroadcast && typeof Value.onMessageBroadcast === "function") {
                    Value.onMessageBroadcast(data);
                }
            });
            ////////////////////////////////////
            //房管设置
            ////////////////////////////////////
            this.SocketIO.on("AdminSet", function (data) {
                if (!$.CommonMainRoom.fnCheckData("AdminSet", data)) {
                    return;
                }
                data = data.Data;
                if (Value.onAdminSet && typeof Value.onAdminSet === "function") {
                    Value.onAdminSet(data);
                }
            });
            ////////////////////////////////////
            //房管设置(广播)
            ////////////////////////////////////
            this.SocketIO.on("AdminSetBroadcast", function (data) {
                console.log("On.AdminSetBroadcast.Succeed");
                if ($.CommonMainRoom.RoomUserInfo && ($.CommonMainRoom.RoomUserInfo.User_ID == data.RoomUserInfo.User_ID)) {
                    $.CommonMainRoom.RoomUserInfo = data.RoomUserInfo;
                    if (Value.fnRoomUserInfo && typeof Value.fnRoomUserInfo === "function") {
                        Value.fnRoomUserInfo(data.RoomUserInfo);
                    }
                }
                if (Value.onAdminSetBroadcast && typeof Value.onAdminSetBroadcast === "function") {
                    Value.onAdminSetBroadcast(data);
                }
            });
            ////////////////////////////////////
            //房间黑名单设置
            ////////////////////////////////////
            this.SocketIO.on("BlackSet", function (data) {
                if (!$.CommonMainRoom.fnCheckData("BlackSet", data)) {
                    return;
                }
                data = data.Data;
                if (Value.onBlackSet && typeof Value.onBlackSet === "function") {
                    Value.onBlackSet(data);
                }
            });
            ////////////////////////////////////
            //房间黑名单设置(广播)
            ////////////////////////////////////
            this.SocketIO.on("BlackSetBroadcast", function (data) {
                console.log("On.BlackSetBroadcast.Succeed");
                if ($.CommonMainRoom.RoomUserInfo && ($.CommonMainRoom.RoomUserInfo.User_ID == data.RoomUserInfo.User_ID)) {
                    $.CommonMainRoom.RoomUserInfo = data.RoomUserInfo;
                    if (Value.fnRoomUserInfo && typeof Value.fnRoomUserInfo === "function") {
                        Value.fnRoomUserInfo(data.RoomUserInfo);
                    }
                }
                if (Value.onBlackSetBroadcast && typeof Value.onBlackSetBroadcast === "function") {
                    Value.onBlackSetBroadcast(data);
                }
                if ($.CommonMainRoom.RoomUserInfo && ($.CommonMainRoom.RoomUserInfo.User_ID == data.RoomUserInfo.User_ID) && data.RoomUserBlackInfo.Join && Value.fnBlackJoin && typeof Value.fnBlackJoin === "function") {
                    Value.fnBlackJoin("您已被禁止进入此房间.有限日期至:" + (data.RoomUserBlackInfo.Join_Expire ? moment(data.RoomUserBlackInfo.Join_Expire).format("YYYY/MM/DD HH:mm:ss") : "永久"));
                }
            });
            // ////////////////////////////////////
            // //房间冻结设置
            // ////////////////////////////////////
            // this.SocketIO.on("BlockSet", function (data) {
            //     if (!$.CommonMainRoom.fnCheckData("BlockSet", data)) {
            //         return;
            //     }
            //     data = data.Data;
            //     if (Value.onBlockSet && typeof Value.onBlockSet === "function") {
            //         Value.onBlockSet(data);
            //     }
            // });
            ////////////////////////////////////
            //房间警告设置
            ////////////////////////////////////
            this.SocketIO.on("WarningSet", function (data) {
                $.CommonMainRoom.fnCheckData("WarningSet", data);
            });
            ////////////////////////////////////
            //房间警告设置（广播）
            ////////////////////////////////////
            this.SocketIO.on("WarningSetBroadcast", function (data) {
                console.log("On.WarningSetBroadcast.Succeed");
                if (Value.onWarningSetBroadcast && typeof Value.onWarningSetBroadcast === "function") {
                    Value.onWarningSetBroadcast(data);
                }
            });
            /////////////////////////////////
            //转盘抽奖
            /////////////////////////////////
            this.SocketIO.on("Lottery", function (data) {
                if (!$.CommonMainRoom.fnCheckData("Lottery", data)) {
                    return;
                }
                if (Value.onLottery && typeof Value.onLottery === "function") {
                    Value.onLottery(data);
                }
                $.CommonMainRoom.UserPackage = data.UserPackage || $.CommonMainRoom.UserPackage;
                if (data.UserPackage && Value.fnUserPackage && typeof Value.fnUserPackage === "function") {
                    Value.fnUserPackage(data.UserPackage);
                }
                if (Value.fnRoomUserInfo && typeof Value.fnRoomUserInfo === "function") {
                    Value.fnRoomUserInfo(data.RoomUserInfo);
                }

            });
            /////////////////////////////////
            //转盘抽奖-广播
            /////////////////////////////////
            this.SocketIO.on("LotteryBroadcast", function (data) {
                if (!$.CommonMainRoom.fnCheckData("LotteryBroadcast", data)) {
                    return;
                }
                if (Value.onLotteryBroadcast && typeof Value.onLotteryBroadcast === "function") {
                    Value.onLotteryBroadcast(data);
                }
            });
            /////////////////////////////////
            //砸蛋游戏
            /////////////////////////////////
            this.SocketIO.on("PoundEgg", function (data) {
                if (!$.CommonMainRoom.fnCheckData("PoundEgg", data)) {
                    return;
                }
                if (Value.onPoundEgg && typeof Value.onPoundEgg === "function") {
                    Value.onPoundEgg(data);
                }
                $.CommonMainRoom.UserPackage = data.UserPackage || $.CommonMainRoom.UserPackage;
                if (data.UserPackage && Value.fnUserPackage && typeof Value.fnUserPackage === "function") {
                    Value.fnUserPackage(data.UserPackage);
                }
                if (Value.fnRoomUserInfo && typeof Value.fnRoomUserInfo === "function") {
                    Value.fnRoomUserInfo(data.RoomUserInfo);
                }
            });
            /////////////////////////////////
            //砸蛋游戏-广播
            /////////////////////////////////
            this.SocketIO.on("PoundEggBroadcast", function (data) {
                if (!$.CommonMainRoom.fnCheckData("PoundEggBroadcast", data)) {
                    return;
                }
                if (Value.onPoundEggBroadcast && typeof Value.onPoundEggBroadcast === "function") {
                    Value.onPoundEggBroadcast(data);
                }
            });
        },
        ////////////////////////////////////
        //SocketEmit
        ////////////////////////////////////
        SocketEmit: {
            ////////////////////////////////////
            //进入房间
            ////////////////////////////////////
            Join: function (id) {
                console.log("Emit.Join");
                $.CommonMainRoom.SocketIO.emit("Join", id);
            },
            ////////////////////////////////////
            //用户列表
            ////////////////////////////////////
            UserList: function () {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.UserList.NoJoin");
                    return;
                }
                console.log("Emit.UserList");
                $.CommonMainRoom.SocketIO.emit("UserList");
            },
            ////////////////////////////////////
            //管理员列表
            ////////////////////////////////////
            AdminList: function () {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.AdminList.NoJoin");
                    return;
                }
                console.log("Emit.AdminList");
                $.CommonMainRoom.SocketIO.emit("AdminList");
            },
            ////////////////////////////////////
            //黑名单列表
            ////////////////////////////////////
            BlackList: function () {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.BlackList.NoJoin");
                    return;
                }
                console.log("Emit.BlackList");
                $.CommonMainRoom.SocketIO.emit("BlackList");
            },
            ////////////////////////////////////
            //守护列表
            ////////////////////////////////////
            GuardianList: function () {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.GuardianList.NoJoin");
                    return;
                }
                console.log("Emit.GuardianList");
                $.CommonMainRoom.SocketIO.emit("GuardianList");
            },
            ////////////////////////////////////
            //开始直播
            ////////////////////////////////////
            Live: function (Title, Notice) {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.Live.NoJoin");
                    return;
                }
                console.log("Emit.Live");
                $.CommonMainRoom.SocketIO.emit("Live", Title, Notice);
            },
            ////////////////////////////////////
            //结束直播
            ////////////////////////////////////
            LiveEnd: function () {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.LiveEnd.NoJoin");
                    return;
                }
                console.log("Emit.LiveEnd");
                $.CommonMainRoom.SocketIO.emit("LiveEnd");
            },
            ////////////////////////////////////
            //购买守护
            ////////////////////////////////////
            Guardian: function (id) {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.Guardian.NoJoin");
                    return;
                }
                console.log("Emit.Guardian");
                $.CommonMainRoom.SocketIO.emit("Guardian", id);
            },
            ////////////////////////////////////
            //购买礼物
            //purchasemode: 购买模式 0:先用包裹然后购买(默认) 1:只购买 2:只用包裹
            ////////////////////////////////////
            Gift: function (giftId, num, userid, purchasemode) {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.Gift.NoJoin");
                    return;
                }
                console.log("Emit.Gift");
                $.CommonMainRoom.SocketIO.emit("Gift", giftId, num, userid, purchasemode);
            },
            ////////////////////////////////////
            //喇叭购买
            //purchasemode: 购买模式 0:先用包裹然后购买(默认) 1:只购买 2:只用包裹
            ////////////////////////////////////
            Horn: function (mode, msg, purchasemode) {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.Horn.NoJoin");
                    return;
                }
                console.log("Emit.Horn");
                $.CommonMainRoom.SocketIO.emit("Horn", mode, msg, purchasemode);
            },
            ////////////////////////////////////
            //领取星星
            ////////////////////////////////////
            PomeloGet: function () {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.PomeloGet.NoJoin");
                    return;
                }
                console.log("Emit.PomeloGet");
                $.CommonMainRoom.SocketIO.emit("PomeloGet");
            },
            ////////////////////////////////////
            //赠送星星
            ////////////////////////////////////
            PomeloPresent: function (num) {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.PomeloPresent.NoJoin");
                    return;
                }
                console.log("Emit.PomeloPresent");
                $.CommonMainRoom.SocketIO.emit("PomeloPresent", num);
            },
            ////////////////////////////////////
            //发送消息
            ////////////////////////////////////
            Message: function (msg, id, pte) {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.Message.NoJoin");
                    return;
                }
                console.log("Emit.Message");
                $.CommonMainRoom.SocketIO.emit("Message", msg, id, pte);
            },
            ////////////////////////////////////
            //房管设置
            ////////////////////////////////////
            AdminSet: function (id, admin) {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.AdminSet.NoJoin");
                    return;
                }
                if (!$.CommonMainRoom.RoomUserInfo.RoomAnchor) {
                    console.log("Emit.AdminSet.NoRoomAnchor");
                    return;
                }
                console.log("Emit.AdminSet");
                $.CommonMainRoom.SocketIO.emit("AdminSet", id, admin);
            },
            ////////////////////////////////////
            //黑名单设置
            //id:被操作人ID
            //type:操作类型 1：禁言，2：踢人，3：取消禁言，4：取消踢人
            //mode:禁言或踢人,的类型，["NEVER", "YEAR", "MONTH", "WEEK", "DAY", "HOUR", "MINUTE"]
            //value:操作类型 禁言或踢人的时间值
            ////////////////////////////////////
            BlackSet: function (id, type, mode, value) {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.BlackSet.NoJoin");
                    return;
                }
                if (!$.CommonMainRoom.RoomUserInfo.RoomAnchor && !$.CommonMainRoom.RoomUserInfo.RoomAdmin) {
                    console.log("Emit.BlackSet.NoRoomAnchor&NoRoomAdmin");
                    return;
                }
                console.log("Emit.BlackSet");
                $.CommonMainRoom.SocketIO.emit("BlackSet", id, type, mode, value);
            },
            ////////////////////////////////////
            //房间冻结操作
            //block:true:冻结 false:解冻
            ////////////////////////////////////
            BlockSet: function (block, des) {
                if (!$.CommonMainRoom.Join) {
                    console.log("Emit.BlockSet.NoJoin");
                    return;
                }
                console.log("Emit.BlockSet");
                $.CommonMainRoom.SocketIO.emit("BlockSet", block, des);
            },
            /////////////////////////////////
            //转盘游戏
            /////////////////////////////////
            Lottery: function (data) {
                $.CommonMainRoom.SocketIO.emit("Lottery", data);
            },
            /////////////////////////////////
            //砸蛋游戏
            /////////////////////////////////
            PoundEgg: function (data) {
                $.CommonMainRoom.SocketIO.emit("PoundEgg", data);
            }
        }
    }
});